import { createRouter, createWebHashHistory } from "vue-router";
// 路由信息
// ./ 同级别； ../ 上一级；  @/ 根目录src(vite.config.js中已配置)
const routes = [
    {
        path: "/",
        name: "read",
        component: () => import("@/views/read/index.vue"),
    },
    {
        path: "/shop",
        name: "Shop",
        component: () => import("@/views/shop/shop.vue"),
        children: [{
            path: "/home",
            name: "home",
            component: () => import("@/views/shop/index/index.vue"),
        }, 
        {
            path: "/index",
            name: "首页",
            component: () => import("@/views/shop/index/index.vue"),
        },
        {
            path: "/community",
            name: "社区",
            component: () => import("@/views/shop/community/index.vue"),
        },
        {
            path: "/welfare",
            name: "福利",
            component: () => import("@/views/shop/welfare/index.vue"),
        },
        {
            path: "/my",
            name: "我的",
            component: () => import("@/views/shop/my/index.vue"),
        },
        {
            path: "/login",
            name: "登录",
            component: () => import("@/views/shop/my/login.vue"),
        }]
    },
    
/*     {
        path: "/about",
        name: "About",
        component: () => import("@/views/About.vue"),
    },*/
]

const router = createRouter({
    history: createWebHashHistory(),
    routes,
    linkActiveClass: "selected",
})

export default router